<%@ include file="/WEB-INF/jsp/includes.jsp" %>
<%@ include file="/WEB-INF/jsp/header.jsp" %>
<c:choose>
	<c:when test="${patientBean.id != null}">
		<c:set var="method" value="post"/>
	</c:when>
	<c:otherwise>
		<c:set var="method" value="put"/>
	</c:otherwise>
</c:choose>

<h2>
	<c:if test="${patientBean.id == null}">
		New 
	</c:if>
	patient:
</h2>
<form:form modelAttribute="patientBean" method="${method}">
  <table>
    <tr>
      <th>
        <fmt:message key="form.patients.name" /><form:errors path="name" cssClass="errors"/>
        <br/>		
        <form:input path="name" size="30" maxlength="80"/>
      </th>
    </tr>
    <tr>
      <th>
        <fmt:message key="form.patients.lastname" /><form:errors path="lastName" cssClass="errors"/>
        <br/>
        <form:input path="lastName" size="30" maxlength="80"/>
      </th>
    </tr>
    <tr>
      <th>
        <fmt:message key="form.patients.historynumber" /><form:errors path="history" cssClass="errors"/>
        <br/>
        <form:input path="history" size="30" maxlength="80"/>
      </th>
    </tr>
          <td>
        <c:choose>
          <c:when test="${patientBean.id != null}">
            <p class="submit"><input type="submit" value="Update Patient"/></p>
          </c:when>
          <c:otherwise>
            <p class="submit"><input type="submit" value="Add Patient"/></p>
            </c:otherwise>
        </c:choose>
      </td>
      <td>
      <p class="submit"><input type="submit" value="View Generated Pdfs"/></p>
      </td>
    </tr>
  </table>
</form:form>

<%@ include file="/WEB-INF/jsp/footer.jsp" %>
